<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Manazra.Helpers.PaginatedList<Manazra.Models.Blog>>" %>
<%@ Import Namespace="Manazra.Helpers" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	MANAZRA - Blogs
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Blogs</h2>
    <% foreach (var item in Model) { %>    
        <div class="entry">                            
            <div class="label">
                <%= String.Format("<a href='/Blogs/Details/{0}'>{1}</a>", item.RecId + "_" + Html.Encode(item.Title.Replace(' ', '_')) + "_" + Html.Encode(item.Author.Replace(' ', '_')), Html.FormatUserName(item.Author, false) + "'s Blog - " + Html.Encode(item.Title)) %>
            </div>
            <div class="info">                
                Started: <%= Html.Encode(String.Format("{0:g}", item.CreatedDate)) %>                
            </div>
            <% Html.RenderPartial("~/Views/Blogs/UserControls/BlogEntries.ascx", item); %>
        </div>
    <% } %>

    <div class="pagingbar" style="text-align: center;">
        <% if (Model.HasPreviousPage) { %>
            <%= Html.ActionLink("Previous Page", ViewContext.RouteData.Values["action"].ToString(), new { page = (Model.PageIndex - 1) }, new { @class = "left" }) %>
        <%} if(Model.HasNextPage){ %>
            <%= Html.ActionLink("Next Page", ViewContext.RouteData.Values["action"].ToString(), new { page = (Model.PageIndex + 1) }, new { @class = "right" }) %>            
        <%} %>
        Page <%= Model.PageIndex+1 %> of <%= Model.TotalPages %>
    </div>
        
</asp:Content>

